<div style="width:680px; float:left; margin-right:5px" class="border_radius">

<?php

	include_once("../../coms/xl_tintuc.php");

	$lt = new xl_tintuc();

	$arr_lt = $lt->Load_TinTuc();

	if(isset($_REQUEST['act']) && isset($_REQUEST['id'])):

		$act = $_REQUEST['act'];

		$id = $_REQUEST['id'];

		if($act == 'del' && is_numeric($id)):

			$dv = new xl_tintuc();

			$arr_dv = $dv->Load_TinTucTheoMa($id);

			if($arr_dv['hinhanh'] != "")

			{

				unlink("../../".$arr_dv['hinhanh']."");	

			}

			$xoa = new xl_tintuc();

			$kq2 = $xoa->xoa_tin_tuc($id);

			echo '<script type="text/javascript">

						alert("Xóa tin tức thành công!!!");					

					</script>';

			echo '<meta http-equiv="refresh" content="0;url=trangchu.php?key=qltt"  />';

		endif;

	endif;		

?>



<div class="content_right_title_admin">
Quản lý tin tức
    

</div>     



<div class="content_right_group_admin box_shadow" style="padding-bottom:5px">

    <div style="display:block; text-align:right">

        <div style="padding-top:10px; padding-bottom:10px; padding-left:10px" >

             <a href="trangchu.php?key=t_qltt" class="button medium blue">Thêm tin tức</a> <br>        

        </div>

    </div>

    

    <table width="100%" cellspacing="0" style="padding-left:5px; padding-right:5px;" id="myTable">

        <tr bgcolor="#999999">

            <th align="center" valign="middle" width="5%">

                STT

            </th>

            <th align="center" valign="middle" >

                Tên tin tức

            </th>

            <th align="center" valign="middle" width="30%">

                Chức năng

            </th>

        </tr>

    <?php

    for ($i=0; $i<count($arr_lt); $i++):

        $row = $arr_lt[$i];

    ?>

        <tr style="border-bottom:#666;">

            <td align="center" valign="middle">

                <?php echo $i+1; ?>

            </td>

            <td align="center" valign="middle">

                <?php echo $row['tieude']; ?>

            </td>

            <td align="center" valign="middle">

                <a href="trangchu.php?key=nd&malt=7&id=<?php echo $row['matintuc']; ?>" class="button medium blue">Chi tiết</a>

                <a href="trangchu.php?key=qltt&act=del&id=<?php echo $row['matintuc']; ?>" class="button medium blue" onclick="javascript: return confirm('Bạn chắc muốn xóa tin tức không?');">Xóa</a>

            </td>

        </tr>

    <?php

    endfor;

    ?>

    </table>

    </div>

</div>